{extend name="./oscshop/admin/view/public/base.html" /}
{block name="content"}
<div class="page-header">
	<h1>	
		{$breadcrumb1}
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$breadcrumb2}
		</small>
	</h1>
</div>

	
<table class="table table-striped table-bordered table-hover search-form">
	<thead>
		
		<th>
			<input name="user_name" type="text" placeholder="输入会员电话号码" value="{:input('param.user_name')}" />
			<input name="idcardname" type="text" placeholder="真实姓名" value="{:input('param.idcardname')}" />
			<input name="nickname" type="text" placeholder="昵称" value="{:input('param.nickname')}" />
			<select name="user_state" id="user_state">
				<option value='0' {if condition="$user_state eq 0"}selected{/if}>所有</option>
				<option value="1" {if condition="$user_state eq 1"}selected{/if}>游客</option>
				<option value="2" {if condition="$user_state eq 2"}selected{/if}>VIP会员</option>
			</select>
		</th>		
		
		<th>
			<a class="btn btn-primary" href="javascript:;" id="search" url="{:url('MemberBackend/user_rang_num')}">查询</a>
		</th>
	</thead>
	

</table>	
	
<div class="row">
	<div class="col-xs-12">	
		<div class="table-responsive">
			<table class="table table-striped table-bordered table-hover">
				<thead>
					<tr>											
						<th>用户id</th>
						<th>手机号</th>
						<th>昵称</th>
						<th>姓名</th>
						<th>会员级别</th>
						<th>允许老用户理财</th>
					</tr>
				</thead>
				<tbody>
						{volist name="list" id="v" empty="$empty"}
						<tr>						
							<td>{$v.uid}</td>
							<td>
								{if condition="$v['reg_type'] NEQ 'weixin'"}
									{$v.username}
								{else/}
									{$v.nickname}
								{/if}
							</td>
							<td>{$v.nickname}</td>
							<td>{$v.idcardname}</td>
							<td>

								{if condition="$v['user_state'] eq '0'"}
									游客
								{/if}
								{if condition="$v['user_state'] eq '1'"}
									VIP会员
								{/if}
								{if condition="$v['user_state'] eq '2'"}
									代理
								{/if}
							</td>
							<td>
								{switch name="v.user_rang_num"}
								{case value="1"}<a href='{:url("MemberBackend/update_user_rang_num",array("username"=>$v["username"],"status"=>0))}' title="是"><span class="btn btn-xs btn-success"><i class="fa fa-check bigger-120"></i></span></a>{/case}
								{case value="0"}<a href='{:url("MemberBackend/update_user_rang_num",array("username"=>$v["username"],"status"=>1))}' title="否"><span class="btn btn-xs btn-danger"><i class="fa fa-remove bigger-120"></i></span></a>{/case}
								{/switch}
							</td>
						</tr>
						{/volist}	
						
						<tr>
							<td colspan="20" class="page">{$list->render()}</td>
						</tr>
				</tbody>
				
			</table>
		</div>
	</div>
</div>
{/block}
{block name="javascript"}
<script>	
$(function(){
   $("#search").click(function () {
        var url = $(this).attr('url');
        var query = $('.search-form').find('input,select').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        query = query.replace(/^&/g, '');
        if (url.indexOf('?') > 0) {
            url += '&' + query;
        } else {
            url += '?' + query;
        }
        window.location.href = url;
    });	

      $("#search1").click(function () {
        var url = $(this).attr('url');
        var query = $('.search-form').find('input,select').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        query = query.replace(/^&/g, '');
        if (url.indexOf('?') > 0) {
            url += '&' + query;
        } else {
            url += '?' + query;
        }
        //alert(url);
        window.location.href = url;
    });	
});
</script>
{/block}